<%@page import="com.neiquan.backstage.pub.bsc.dao.po.Entrepreneur"%>
<%@page import="com.neiquan.backstage.resourec_manage.EntrepreneurService"%>
<%@page import="com.neiquan.backstage.platform_alliance_member.PlatformAllianceMemberService"%>
<%@page import="com.neiquan.backstage.pub.bsc.dao.po.PlatformAllianceMember"%>
<%@page import="com.neiquan.backstage.event.EventService"%>
<%@page import="com.neiquan.backstage.pub.bsc.dao.po.Event"%>
<%@page import="java.util.List"%>
<%@page import="com.neiquan.backstage.common.CommonService"%>
<%@page import="com.neiquan.backstage.common.util.SpringContextUtils"%>
<%@page import="org.springframework.context.ApplicationContext"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
ApplicationContext appCtx = SpringContextUtils.getApplicationContext();
CommonService commonService = appCtx.getBean(CommonService.class);
EntrepreneurService entrepreneurService = appCtx.getBean(EntrepreneurService.class);
String memberId1=request.getParameter("memberId");
int id=Integer.parseInt(memberId1);
System.out.println(id);
List<Entrepreneur> entrepreneurs = entrepreneurService.queryAll(id);
pageContext.setAttribute("entrepreneurs", entrepreneurs);

%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
	<meta charset="UTF-8">
	<title>账号绑定</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=1.0" />
	<meta name="apple-mobile-web-app-capable" content="yes" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<link rel="stylesheet" href="css/base.css" />
	<link rel="stylesheet" href="css/main.css" />
	</head>
	<body bgcolor="#f0f0f0" id="app" ng-app="app" ng-controller="ctrl">
		<div id="errMsg"></div>
		<section class="mt">
			<section class="common_bg">
				<p class="account-title pd">账号信息</p>
				<section class="line"></section>
				<section class="tc">
					<form id="bindform" class="fom" action="api/user/bindinAccount" method="post">
						<input type="hidden" name="memberId" value='${param.memberId}'/>
						<p class="form-inpt-p">
							<label>注册手机号</label><input class="inpt" ng-model="phone" form="bindform" name="phone" type="text" placeholder="请输入您的手机号码" />
						</p>
						<p class="form-inpt-p">
							<label>登录密码</label><input class="inpt" ng-model="pwd" form="bindform" name="password" type="password" placeholder="请输入您的密码" />
						</p>
						<!-- <p class="form-inpt-p">
							<label>验证码</label><input class="inpt identifycode" form="bindform" required name="identify" type="text" />
							<button class="btn getcode" ng-click="bindinVerify()">获取验证码</button>
						</p> -->
						<button class="btn fom-submit bindform-sub" type="submit" ng-click="bindin()">立即绑定</button>
					</form>
				</section>
			</section>
		</section>
	</body>
	<script src="js/jquery.min.js"></script>
	<script src="angular-1.5.0-rc.2/angular.js"></script>
	<script src="js/main.js"></script>
	<script src="js/responsive.js"></script>
	<script src="js/common.js"></script>
	<script>
	var app = angular.module("app", []);
	app.controller('ctrl', function($scope, $http, $httpParamSerializer, $injector, $window) {
	if('${param.message}'!=null&&'${param.message}'!=""){
		alert('${param.message}');
	}	
	$scope.bindin = function(){
		jQuery("#bindform").submit();
	}
	//获取验证码
	var n = 60
		jQuerycode = jQuery('.getcode');
	function num(){
		jQuerycode.text(n);
		n-=1;
		b=0;
		if(n < 0){
			jQuerycode.text("重新获取").css('background','#DD1215');
			clearInterval(myTime);
			n=60;
		}
	}
	$scope.bindinVerify=function(){
		if(n==60){
		myTime = setInterval(num,1000);
		setTimeout(function(){
			jQuerycode.css('background','#ccc');
		},1000);
		var param = {
				"phone": $scope.phone
			}; 
			jQuery.post("api/user/bindinVerify", param, function(data) {
				if (isErr(data)) {
					showErrMsg(data);
					return;
				}
			});
		}
	};
});
</script>
<script>

</script>
</html>
